'use strict';

angular.module('ProduceWork').controller('CompletePlanListController', ['$scope', 'BaseFunction', 'BaseModule', 'BaseEnum', 'ProduceWorkEnum', '$location', 'Authentication',
    function($scope, BaseFunction, BaseModule, BaseEnum, ProduceWorkEnum, $location, Authentication) {
        $scope.StatusEnum = BaseFunction.getEnum('ProduceWorkEnum.CompletePlanStatus');

    	BaseModule.initModule($scope, 'CompletePlan');
        $scope.Module.CompletePlan.LoadMode = BaseEnum.LoadMode.CacheAndPaging;
        $scope.Module.CompletePlan.Populate = [{path: 'ItemMaster', select: 'Code Name'}];
        $scope.Module.CompletePlan.PageSize = 16;

        $scope.rowDblClick = function(){
            $scope.$apply(function(){
                $location.url("/index/CompletePlan/Edit/" + $scope.Module.CompletePlan.FocusedRecord._id);
            });
        };
    }
]);